// Lang_34 [unary inc-dec operators].nova // The application class. class UnaryIncDecOperatorsApp { // Application class's "main" function. public static void main( String[] args ) { Integer i1 = new Integer( 0 ); // i = 0. Integer i2; Stream.writeLine( "i1 = " + i1.toString( ) ); i2 = i1++; // i2 = 0, i1 = 1. Stream.writeLine( "i2 = " + i2.toString( ) + ", i1 = " + i1.toString( ) ); i2 = ++i1; // i2 = 2, i1 = 2. Stream.writeLine( "i2 = " + i2.toString( ) + ", i1 = " + i1.toString( ) ); // Test a for loop. Integer x; for ( x = new Integer( 0 ); x < new Integer( 10 ); ++x ) { // Output the value of x. Stream.writeLine( "x = " + x.toString( ) ); } // Output the final value of x. Stream.writeLine( "final value of x = " + x.toString( ) ); } }